7 research outputs found
Source Code Verification for Embedded Systems using Prolog
System relevant embedded software needs to be reliable and, therefore, well
tested, especially for aerospace systems. A common technique to verify programs
is the analysis of their abstract syntax tree (AST). Tree structures can be
elegantly analyzed with the logic programming language Prolog. Moreover, Prolog
offers further advantages for a thorough analysis: On the one hand, it natively
provides versatile options to efficiently process tree or graph data
structures. On the other hand, Prolog's non-determinism and backtracking eases
tests of different variations of the program flow without big effort. A
rule-based approach with Prolog allows to characterize the verification goals
in a concise and declarative way.
In this paper, we describe our approach to verify the source code of a flash
file system with the help of Prolog. The flash file system is written in C++
and has been developed particularly for the use in satellites. We transform a
given abstract syntax tree of C++ source code into Prolog facts and derive the
call graph and the execution sequence (tree), which then are further tested
against verification goals. The different program flow branching due to control
structures is derived by backtracking as subtrees of the full execution
sequence. Finally, these subtrees are verified in Prolog.
We illustrate our approach with a case study, where we search for incorrect
applications of semaphores in embedded software using the real-time operating
system RODOS. We rely on computation tree logic (CTL) and have designed an
embedded domain specific language (DSL) in Prolog to express the verification
goals.Comment: In Proceedings WLP'15/'16/WFLP'16, arXiv:1701.0014
Integration von Prolog und Java mit Hilfe der Connector Architecture CAPJa
Modern software is often realized as a modular combination of subsystems for, e. g.,
knowledge management, visualization, verification, or the interaction with users. As
a result, software libraries from possibly different programming languages have to
work together. Even more complex the case is if different programming paradigms
have to be combined. This type of diversification of programming languages and
paradigms in just one software application can only be mastered by mechanisms
for a seamless integration of the involved programming languages. However, the
integration of the common logic programming language Prolog and the popular
object-oriented programming language Java is complicated by various interoperability
problems which stem on the one hand from the paradigmatic gap between the
programming languages, and on the other hand, from the diversity of the available
Prolog systems.
The subject of the thesis is the investigation of novel mechanisms for the integration
of logic programming in Prolog and object–oriented programming in Java. We are
particularly interested in an object–oriented, uniform approach which is not specific
to just one Prolog system. Therefore, we have first identified several important
criteria for the seamless integration of Prolog and Java from the object–oriented
perspective. The main contribution of the thesis is a novel integration framework
called the Connector Architecture for Prolog and Java (CAPJa). The framework is
completely implemented in Java and imposes no modifications to the Java Virtual
Machine or Prolog. CAPJa provides a semi–automated mechanism for the integration
of Prolog predicates into Java. For compact, readable, and object–oriented
queries to Prolog, CAPJa exploits lambda expressions with conditional and relational
operators in Java. The communication between Java and Prolog is based
on a fully automated mapping of Java objects to Prolog terms, and vice versa. In
Java, an extensible system of gateways provides connectivity with various Prolog
system and, moreover, makes any connected Prolog system easily interchangeable,
without major adaption in Java.Moderne Software ist oft modular zusammengesetzt aus Subsystemen zur Wissensverwaltung,
Visualisierung, Verfikation oder Benutzerinteraktion. Dabei müssen
Programmbibliotheken aus möglicherweise verschiedenen Programmiersprachen miteinander
zusammenarbeiten. Noch komplizierter ist der Fall, wenn auch noch verschiedene
Programmierparadigmen miteinander kombiniert werden. Diese Art der
Diversifikation an Programmiersprachen und –paradigmen in nur einer Software
kann nur von nahtlosen Integrationsmechansimen für die beteiligten Programmiersprachen
gemeistert werden. Gerade die Einbindung der gängigen Logikprogrammiersprache
Prolog und der populären objektorientierten Programmiersprache
Java wird durch zahlreiche Kompatibilitätsprobleme erschwert, welche auf der einen
Seite von paradigmatischen Unterschieden der beiden Programmiersprachen herrühren
und auf der anderen Seite von der Vielfalt der erhältlichen Prologimplementierungen.
Gegenstand dieser Arbeit ist die Untersuchung von neuartigen Mechanismen für
die Zusammenführung von Logikprogrammierung in Prolog und objektorienter
Programmierung in Java. Besonders interessiert uns dabei ein objektorientierter,
einheitlicher Ansatz, der nicht auf eine konkrete Prologimplementierung festgelegt
ist. Aus diesem Grund haben wir zunächst wichtige Kriterien für die nahtlose Integration
von Prolog und Java aus der objetorientierten Sicht identifziert. Der
Hauptbeitrag dieser Arbeit ist ein neuartiges Integrationssystems, welches Connector
Architecture for Prolog and Java (CAPJa) heißt. Das System ist komplett in
Java implementiert und benötigt keine Anpassungen der Java Virtual Machine
oder Prolog. CAPJa stellt einen halbautomatischen Mechanismus zur Vernetzung
von Prolog Prädikaten mit Java zur Verfügung. Für kompakte, lesbare und objektorientierte
Anfragen an Prolog nutzt CAPJa Lambdaausdrücke mit logischen
und relationalen Operatoren in Java. Die Kommunikation zwischen Java und Prolog
basiert auf einer automatisierten Abbildung von Java Objekten auf Prolog
Terme, und umgekehrt. In Java bietet ein erweiterbares System von Schnittstellen
Konnektivität zu einer Vielzahl an Prologimplmentierung und macht darüber hinaus jede verbundene Prologimplementierung einfach austauschbar, und zwar ohne größere Anpassung in Java
Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development
Abstract. Modern software often relies on the modular combination of several software subsystems, for instance rule-based subsystems for decision support, verification or knowledge management. Different software libraries in potentially different programming languages have to work together in just a single application. Even more complex is the case when different programming paradigms are combined. Such a diversification of programming languages and modules in just a single software application can only be mastered by smooth integration techniques that retain the power of different programming paradigms. Unfortunately, for the popular object-oriented programming language JAVA and the common logic programming language PROLOG occurring interoperability problems still are not solved sufficiently. To overcome various external and internal issues of former approaches we propose an intuitive and portable Connector Architecture for PROLOG and JAVA (CAPJA). A concise, extensible and independent communication layer with a pluggable interface system allows for a seamless integration of PROLOG programs in JAVA. Compared to former approaches we could reduce the code for the mere communication to a minimum. Several case studies with different PROLOG systems document not only the portability but the overall applicability of our approach